package br.great.DAO;

import java.sql.SQLException;
import java.util.logging.Level;
import java.util.logging.Logger;

/**
* PhotoMap
* Copyright (c) 2007-2008 STEAMER - LIG, All rights reserved.
*/

/**
 * @author Developpement of PhotoMap
 */
public class DAO_PhotoHasContentAnnotation {
    int i;
    
    private static volatile DAO_PhotoHasContentAnnotation instaceDAO_PhotoHasContentAnnotation = new DAO_PhotoHasContentAnnotation();
    
    /** The private constructor of DAO_PhotoHasContentAnnotation for singleton
    */
    private DAO_PhotoHasContentAnnotation(){
    
    }
    
    /** The method for get the instance of the class DAO_PhotoHasContentAnnotation
    * @return DAO_PhotoHasContentAnnotation instaceDAO_PhotoHasContentAnnotation
    */
    public static DAO_PhotoHasContentAnnotation getInstance() {
        //if(instaceDAO_PhotoHasContentAnnotation==null)
           synchronized(DAO_PhotoHasContentAnnotation.class) {
             if (instaceDAO_PhotoHasContentAnnotation == null)
               instaceDAO_PhotoHasContentAnnotation = new DAO_PhotoHasContentAnnotation();
           }
        return instaceDAO_PhotoHasContentAnnotation;
    }
    
    public void insertPhotoHasContentAnnotation(int idMultimedia, int contentA){
        try {
            String insertPhotoHasContentAnnotation = "insert into Photo_Has_Content_Annotation values(" + contentA + "," + idMultimedia + ");";
//System.out.println(insertPhotoHasContentAnnotation);
            PgConnect conn = PgConnect.getInstance();
            conn.executeInsert(insertPhotoHasContentAnnotation);
            conn.Close();
        } catch (SQLException ex) {
            Logger.getLogger(DAO_PhotoHasContentAnnotation.class.getName()).log(Level.SEVERE, null, ex);
        }
    }

//    public static void main(String[] args){
//        DAO_PhotoHasContentAnnotation dphca = DAO_PhotoHasContentAnnotation.getInstance();
//        dphca.insertPhotoHasContentAnnotation(1, 1);
//    }
}
